
<template>
<div>
  <el-menu
 
  :default-active="$route.path"
  class="el-menu-demo"
  mode="horizontal"
  router
  background-color="#545c64"
  text-color="#fff"
  active-text-color="#ffd04b">

 
    <el-menu-item index="/admin/baoyue">包月用户</el-menu-item>
    <el-menu-item index="/admin/no-pay">申请通过但尚未支付用户</el-menu-item>
      <el-menu-item index="/admin/no-pass">等待申请通过用户</el-menu-item>
  
 
</el-menu>
  <card class="strpied-tabled-with-hover" body-classes=" table-responsive">
    <template slot="header">
      <h4 class="card-title">包月用户</h4>
      <p class="card-category"></p>
    </template>
  
    <div style="margin-top: 15px;">
      <div class="search">
        <el-input placeholder="请输入内容" v-model="input5" class="input-with-select">
          <el-select v-model="select" slot="prepend" placeholder="请选择">
            <el-option label="提交审核者姓名" value="1"></el-option>
            <el-option label="停车场地址" value="2"></el-option>
            <el-option label="权限" value="3"></el-option>
          </el-select>
          <el-button slot="append" icon="el-icon-search"></el-button>
        </el-input>
      </div>
    </div>
    <el-table :data="tableData" style="width: 100%" :row-class-name="tableRowClassName"  row-key="id">
      <el-table-column prop="id" label="ID" width="180"></el-table-column>
      <el-table-column prop="username" label="用户姓名" width="180"></el-table-column>
      <el-table-column   prop="license" label="车牌号" width="180" >
       
      </el-table-column>
       <el-table-column prop="address" label="停车场地址" width="180"></el-table-column>
      
       <el-table-column prop="title" label="停车场名称" width="180"></el-table-column>
      
      <el-table-column label="操作">
        <template slot-scope="scope">
       
        <el-button type="text" @click="deleteIT(scope.row)">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <div class="row">
      <el-pagination layout="prev, pager, next" :total="50" class="col-10"></el-pagination>
     
    </div>
  </card>
  </div>
</template>
<style>
.el-select .el-input {
  width: 130px;
}
.input-with-select .el-input-group__prepend {
  background-color: #fff;
}
.el-table .warning-row {
  background: oldlace;
}

.el-table .success-row {
  background: #f0f9eb;
}
</style>
<script>
import LTable from "src/components/Table.vue";
import Card from "src/components/Cards/Card.vue";

export default {
  components: {
    LTable,
    Card
  },
  data() {
    return {
      select: "",
      input5: "",
      tableData: [],
      area:[],
      num:""
    };
  },
  created: function() {
    this.getManager();
  },
  methods: {
    getManager() {
      this.$ajax({
        method: "get",
        url: "/month/application"
      })
        .then(res => {
          if (res.data.error_no === 1) {
             
            } else {
              this.$message({
                type: "info",
                message: res.data.error_msg
              });
              console.log(error);
            }
          this.tableData=res.data.data.pass;



        })
        .catch(error => {
         this.$message({
                type: "info",
                message:"您没有权限访问该页面"
         });
        });
    },
    changeIT(row) {
      console.log(row.id);
      this.$router.push({path:"/admin/park-profile",
      query:{
        id:row.id
      }
      }
      );
      //this.$router.push("/admin/manager-profile");
    },
    deleteIT(row) {
      this.$confirm("此操作将永久删除该用户, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(() => {
          this.deleteManager();
          this.$message({
            type: "success",
            message: "删除成功!"
          });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除"
          });
        });
    },
    deleteManager() {
      alert("you delete");
    },
    addManager() {
      this.$router.push("/admin/park-profile");
    },
    tableRowClassName({ row, rowIndex }) {
      if (rowIndex === 1) {
        return "warning-row";
      } else if (rowIndex === 3) {
        return "success-row";
      }
      return "";
    }
  }
};
</script>